package com.lalameow.researchstation

import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder
import net.fabricmc.fabric.api.item.v1.FabricItemSettings
import net.minecraft.item.BlockItem
import net.minecraft.item.ItemGroup
import net.minecraft.item.ItemStack
import net.minecraft.util.registry.Registry

internal fun ResearchStation.registerItem() {
    // 注册item
    Registry.register(
        Registry.ITEM,
        Identifiers.RESEARCH_STATION,
        Items.RESEARCH_STATION
    )
}

private val group =
    FabricItemGroupBuilder.create(Identifiers.RESEARCH_STATION)
        .icon { ItemStack(Blocks.RESEARCH_STATION) }
        .build()

val ResearchStation.itemGroup: ItemGroup
    get() = group

val ResearchStation.items: Items
    get() = Items

object Items {
    val RESEARCH_STATION = BlockItem(Blocks.RESEARCH_STATION, FabricItemSettings().group(group))
}
